<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreatePostsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('posts', function (Blueprint $table) {
            $table->increments('id');
            $table->string('title',100)->default('')->comment('标题');
            $table->string('keywords',100)->default('')->comment('关键字');
            $table->string('desc',255)->default('')->comment('摘要');
            $table->string('thumb',255)->default('')->comment('封面图');
            $table->text('content')->comment('内容');
            $table->tinyInteger('status')->default(1)->comment('状态，-1删除，0禁用，1正常');
            $table->timestamps();
        });
        \Illuminate\Support\Facades\DB::statement("ALTER TABLE `posts` comment '文章表'");
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('posts');
    }
}
